package com.example.sqlite.room;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import java.util.List;

@Dao
public interface AddressDao {
    @Insert
    void insert(Address... addresses);

    @Update
    void update(Address... addresses);

    @Delete
    void delete(Address... addresses);

    @Query("SELECT * from address")
    List<Address> query();

    @Query("SELECT * FROM address WHERE name LIKE :name LIMIT 1")
    Address findByName(String name);

    @Query("DELETE FROM address")
    void deleteAll();
}
